// import { IRouteComponentProps } from 'umi'
// import TearcherLayout from './teachersLayout'
// import StudentLayout from './studentsLayout'
// import './teachersLayout.less'

// const Layout: React.FC<IRouteComponentProps> = (props) => {
//     console.log('props...', props.location.pathname);
//     let contet = props.children;
//     if (/\/teachers/.test(props.location.pathname)) {
//         // return <TearcherLayout>{props.children}</TearcherLayout>
//         contet = <TearcherLayout>{props.children}</TearcherLayout>
//     } else if (/\/students/.test(props.location.pathname)) {
//         // return <StudentLayout>{props.children}</StudentLayout>
//         contet = <StudentLayout>{props.children}</StudentLayout>
//     }
//     // return props.children
//     return <div>
//         <p className="layout-mobile">请在PC端打开使用</p>
//         <div className="layout-pc">
//             {contet}
//         </div>
//     </div>
// }

// export default Layout
// 使用媒体查询处理
import { useEffect, useState } from 'react';
import { IRouteComponentProps } from 'umi'
import TeacherLayout from './teachersLayout'

const Layout: React.FC<IRouteComponentProps> = props => {
 
  let contet =  props.children;
  if (/\/teachers/.test(props.location.pathname)) {
    contet =  <TeacherLayout>{props.children}</TeacherLayout>
  }

  return <div>
    <p className="layout-mobile">请在PC端打开使用</p>
    <div className="layout-pc">
      {contet}
    </div>
  </div>;
// import TearcherLayout from './teachersLayout'
// import StudentLayout from './studentsLayout'
// import TearcherLayout from './teachersLayout'
// import StudentLayout from './studentsLayout'

// const Layout:React.FC<IRouteComponentProps> = (props) => {
//     console.log('props...',props.location.pathname);
    
//     if (/\/teachers/.test(props.location.pathname)) {
//         return <TearcherLayout>{props.children}</TearcherLayout>
//     }else if(/\/students/.test(props.location.pathname)){
//         return <StudentLayout>{props.children}</StudentLayout>
//     }
//     return props.children
}

export default Layout;